package com.example.xuanke.mapper;

import com.example.xuanke.pojo.Classes;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClassesMapper {
    @Select("select * from classes")
    List<Classes> getAll();

    @Insert("insert into classes (name,renshu,shangke,teacher,time) values(#{name},#{renshu},#{shangke},#{teacher},#{time})")
    void add(Classes classes);

    @Update("update classes set name=#{name},shangke=#{shangke},renshu=#{renshu},teacher=#{teacher},time=#{time} where id=#{id}")
    void update(Classes classes);

    @Delete("delete from classes where id=#{id}")
    void delete(Integer id);
}
